
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports _2bMatesSite.BO

Namespace _2bMatesSite
	''' <summary>
	''' Summary description for users_list_for_google.
	''' </summary>
	Public Partial Class users_list_for_google
		Inherits System.Web.UI.Page
		Private usersFound As New ArrayList()
		Private usersFoundCount As Double = 0
		Private filter As New UserFilter()

		Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
			' Put user code to initialize the page here
			usersFound = Users.FindUsers(filter)
			usersFoundCount = usersFound.Count

			If usersFoundCount > 0 Then
				dlResults.Visible = True
				BindList()
			Else
				dlResults.Visible = False
			End If
		End Sub

		Public Sub BindList()
			dlResults.DataSource = CreateDataSourceForList()
			dlResults.DataBind()
		End Sub

		Public Function CreateDataSourceForList() As ICollection
			Dim dt As New DataTable()
			Dim dr As DataRow

			dt.Columns.Add(New DataColumn("Name", GetType(String)))
			dt.Columns.Add(New DataColumn("MemberURL", GetType(String)))

			For Each result As User In usersFound
				dr = dt.NewRow()

				dr(0) = result.Name
				dr(1) = "" + Constants.MEMBERS + "?id=" + result.ID
				dt.Rows.Add(dr)
			Next

			Dim dv As New DataView(dt)
			Return dv
		End Function

		#region Web Form Designer generated code
		Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
			'
			' CODEGEN: This call is required by the ASP.NET Web Form Designer.
			'
			InitializeComponent()
			MyBase.OnInit(e)
		End Sub

		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()

		End Sub
#End Region
	End Class
End Namespace






